Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Inference on cluster #189

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open

Conversation

nikk-nikaznan
Copy link
Collaborator

@nikk-nikaznan nikk-nikaznan commented Jun 21, 2024

@nikk-nikaznan nikk-nikaznan marked this pull request as ready for review July 9, 2024 16:25
@nikk-nikaznan nikk-nikaznan requested a review from sfmig July 9, 2024 16:25
@nikk-nikaznan nikk-nikaznan marked this pull request as draft July 10, 2024 08:09
@nikk-nikaznan nikk-nikaznan marked this pull request as ready for review July 10, 2024 09:49
Copy link
Collaborator

@sfmig sfmig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @nikk-nikaznan and sorry for the delay!

Just two small suggestions.

The first one is to infer whether the path to the videos is a file or a directory from the path itself, rather than passing that with an extra CLI argument. We can do this easily with pathlib's is_dir() or is_file().

The second suggestion is to keep the same output filenaming approach if we pass a directory of videos or a single video as input. Right now, if we pass a directory of videos, the output tracked videos are in a directory which is not timestamped. This is different to the behaviour when we pass a single video and will also overwrite the data if we run the command twice. I gave a suggestion in the comments.

If you have time to implement these changes that would be great! If not let me know and I will do it no problem.

crabs/tracker/track_video.py Show resolved Hide resolved
bash_scripts/run_tracking_all_escape_events.sh Outdated Show resolved Hide resolved
guides/TrackingModelHPC.md Outdated Show resolved Hide resolved
bash_scripts/run_tracking.sh Outdated Show resolved Hide resolved
GIT_BRANCH=main

# Check if the target is not a directory
if [ ! -d "$VIDEO_DIR" ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! ✨

bash_scripts/run_tracking_all_escape_events.sh Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this one! ✨

Maybe going forwards I can combine them to read a dir or a single video, but this is a great starting point

@@ -299,6 +308,11 @@ def tracking_parse_args(args):
action="store_true",
help="Save frame to be used in correcting track labelling",
)
parser.add_argument(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of an additional CLI argument saying if the input is a directory or not, we could derive it from the path.

We can do this with is_dir() and is_file() from Pathlib (example here)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sfmig Just comeback to this. The directory is in the bash, we only pass each video path as args. I am not quite sure what's the best way to do unless we want to do the loop of the bash in the code. But doesn't seem to be neater

crabs/tracker/utils/io.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants